<template>
	<view class="cus-search-container" :style="{'background-color': bgcolor}">
		<view class="cus-search-box" :style="{'border-radius': radius + 'px'}" @click="seachHandler">
			<uni-icons type="search" size="25"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"search",
		data() {
			return {
				
			};
		},
		props: {
			// 封装组件，增强复用性
			bgcolor: {
				type: String,
				default: '#c00000',
			},
			radius: {
				type: Number,
				// 单位px
				default: 15
			}
		},
		methods: {
			// 子传父
			seachHandler() {
				this.$emit('seachHandler')
			}
		}
	}
</script>

<style lang="scss">
	.cus-search-container {
		height: 50px;
		// background-color: #c00000;
		display: flex;
		align-items: center;
		padding: 0 15px;
		.cus-search-box {
			height: 36px;
			background-color: #fff;
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;
			// border-radius: 15px;
			.placeholder {
				margin-left: 5px;
				font-size: 15px;
			}
		}
	}
</style>